#ifndef _RDA_APB_IIC_H__
#define _RDA_APB_IIC_H__

/*
 * MODULE NAME:    hw_i2c_driver.h
 * PROJECT CODE:   BlueStream
 * DESCRIPTION:    Functions to access apb iic
 * MAINTAINER:     
 * DATE:           
 *
 * SOURCE CONTROL: $Id: hw_i2c_driver.h,v 1.1 2008/07/18 03:08:06 tianwq Exp $
 *
 * LICENSE:
 *     This source code is copyright (c) 2008 RDA Inc.
 *     All rights reserved.
 *
 * REVISION HISTORY:
 *
 */

#include "sys_config.h"
#include "sys_types.h"


#define RDA_I2C_GENERAL_DEVICE  0x00 
#define RDA_I2C_EEPROM_DEVICE	0xa0
#define RDA_I2C_CODEC_1_DEVICE	0xda
#define RDA_I2C_CODEC_2_DEVICE	0xda
#define RDA_I2C_GYRO_DEVICE		0xd0


	
u_int32 HW_i2c_read (u_int32 addr, u_int8 devAddr);
u_int32 HW_i2c_write (u_int32 addr, u_int32 data,u_int8 devAddr);

u_int32 HW_i2c_Sequen_read (u_int32 addr,u_int8* data, u_int32 length,u_int8 devAddr);
u_int32 HW_i2c_Sequen_write (u_int32 addr,u_int8* data, u_int32  length,u_int8 devAddr);

void  HW_i2c_Init_hw(void);
u_int8 HW_i2c_EE_Head(u_int32 addr,u_int8* data, u_int32 length);
u_int32 HW_i2c_Data_read(u_int32 addr,u_int8* data, u_int32 length,u_int8 devAddr,u_int8 flag);


void IIC_WriteBytes(u_int8 devAddr,u_int8 IIcDatNO,u_int8* data);
void IIC_ReadBytes(u_int8 devAddr,u_int8 IIcDatNO,u_int8* data);


// for wii special
void wii_IIC_WriteBytes(u_int8 devAddr,u_int8 IIcDatNO,u_int8* data);
void wii_IIC_ReadBytes(u_int8 devAddr,u_int8 IIcDatNO,u_int8* data);

void my_i2c_sequen_write(u_int32 addr,u_int8* data, u_int32  length,u_int8 devAddr);
void my_i2c_sequen_read(u_int32 addr,u_int8* data, u_int32 length,u_int8 devAddr);


/*
void IIC_SendByte(u_int8 Data); 
void  Set_I2c_data_output();
void  Set_I2c_clk_input();
void  Set_I2c_clk_output();
void  Set_I2c_data_input();
void Set_I2c_clk_low();
void  Set_I2c_data_high();


void IIC_Start();
void IIC_Stop();
u_int8 IIC_ReadByteACK(void);
u_int8 IIC_ReadByteNCK(void); 
*/



#endif
